package com.android.miniskirt.ui;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.android.miniskirt.R;

import android.app.Activity;
import android.os.Bundle;
import android.widget.ListView;
import android.widget.SimpleAdapter;

public class bubble9 extends Activity {
    /** Called when the activity is first created. */
    ListView itemlist = null;
    List<Map<String, Object>> list;
    
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.bubble);
        itemlist = (ListView) findViewById(R.id.list1);
        refreshListItems();
    }
    private void refreshListItems() {
        list = buildListForSimpleAdapter();
        SimpleAdapter notes = new SimpleAdapter(this, list, R.layout.item,
                        new String[] { "str" }, new int[] { R.id.TextView01,});
        itemlist.setAdapter(notes);
//        itemlist.setSelection(0);
}
private List<Map<String, Object>> buildListForSimpleAdapter() {
        List<Map<String, Object>> list = new ArrayList<Map<String, Object>>(2);
        // Build a map for the attributes
        Map<String, Object> map = new HashMap<String, Object>();
        map.put("str", "刘诚");
        list.add(map);
       
        map = new HashMap<String, Object>();
        map.put("str", "早上好");
        list.add(map);
       
        map = new HashMap<String, Object>();
        map.put("str", "你好");
        list.add(map);
        return list;
}
}